<?php

namespace Ue\Handlers\Events;

use Illuminate\Contracts\Queue\ShouldBeQueued;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Http\Request;
use Ue\User;
use Carbon\Carbon;

class AuthLogin {

    /**
     * Request 对象
     *
     * @var Illuminate\Http\Request
     */
    protected $request;

    /**
     * Create the event handler.
     *
     * @return void
     */
    public function __construct(Request $request) {
        $this->request = $request;
    }

    /**
     * 处理用户登录
     *
     * @param User    $user     用户
     * @param boolean $remember 是否记住登录
     *
     * @return void
     */
    public function handle(User $user, $remember=false) {
        //$user->last_login_at = Carbon::now();
        //$user->last_ip = $this->request->ip();

        //TODO:其它动作，比如增加积分等等。

        //$user->save();
    }

}
